in_definite
Rust port of indefinite on npm, for deciding which indefinite article to use ('a' or 'an').
Get the indefinite article ('a' or 'an') to match the given word. For example: an umbrella, a user.
Examples
use in_definite;
let result = get_a_or_an;
assert_eq!;
// Irregular word
let result = get_a_or_an;
assert_eq!;
// Title Case
let result = get_a_or_an;
assert_eq!;
let result = is_an;
assert_eq!;
let result = is_an;
assert_eq!;
Deviations from the original indefinite
Upper/lower/mixed case handling:
- a word like THIS will be always considered to be an acronym.
- normally the result is lower case ('a' or 'an')
- title case is handled as: 'Ugly' -> 'An'
- mixed case is handled as: 'uGly' -> 'an'
Adverbs:
- Handles adverbs with '-ly' in a generic manner. Example: "a ubiquitously"
A big thanks to the original authors of indefinite!
Published @ crates.io
https://crates.io/crates/in_definite
licence = MIT
This project is licensed under the MIT License - see the LICENSE file for details